// $Id: nodebloom.h 61 2004-10-22 13:41:50Z hansemil $
#ifndef NODEBLOOM_H
#define NODEBLOOM_H

#include "nodevanilla.h"
#include "bloomfilter.h"
#include <map>

/**
 * Behaves as Vanilla except for the routing. Instead of just using standard
 * Freenet (vanilla) routing, Bloom keeps track of a bloom filter for each node
 * it queries which contains fuzzy data about a neighbors file store. When no
 * bloom filter is available for a node it falls back on vanilla routing.
 */
class NodeBloom : public NodeVanilla {
public:
	NodeBloom(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, float, float, FileHandler *);
	~NodeBloom();

	//bool addNeighbor(Node *, unsigned int);
	StoredFile *storeFile(File *, bool);
	bool routeFile(Node *, NodeRequestFileParameters *);
	void generateRequestOrderList(File *, std::list<KeyDistanceHelper> &);
	void setFileMesh(Node *, BloomFilter *);
	int getFileMeshCount();

private:
	BloomFilter *m_fileMesh;
	std::map<Node *, BloomFilter *> m_fileMeshList;
};

#endif
